package org.benjamin.tenancy.domain.entity;

import java.math.BigDecimal;
import java.util.List;

import javax.persistence.*;

/**
 * Created by xywenjie on 2017/4/11.
 */
@Entity
@Table(name = "tab_housing")
public class Housing extends EntitySuppert{

	@OrderBy
	@Column(name = "number",nullable = false)
    private String number;
	
	@Column(name = "rental")
	private BigDecimal rental;
	
	@OneToOne
	@PrimaryKeyJoinColumn
	private Tenant tenant;
	
	@OneToMany
	@JoinColumn(name = "housing_id")
	private List<UtilitiesInfo> utilitiesInfos;
	
	@OneToMany
	@JoinColumn(name = "before_tenant")
	private List<Tenant> beforeTenant;
	
	@Column(name = "status")
	private boolean status;
	
/*		@Column(name = "building_id")
		private Integer buildingId;*/
	
	@ManyToOne
	@JoinColumn(name = "building_id")
	private Building building;
	
	@OneToMany
	@JoinColumn(name = "housing_id")
	private List<IncomeInfo> incomeInfos;

	public String getNumber() {
		return number;
	}

	public void setNumber(String number) {
		this.number = number;
	}

	public Tenant getTenant() {
		return tenant;
	}

	public void setTenant(Tenant tenant) {
		this.tenant = tenant;
	}

	public boolean isStatus() {
		return status;
	}

	public void setStatus(boolean status) {
		this.status = status;
	}

	public List<UtilitiesInfo> getUtilitiesInfos() {
		return utilitiesInfos;
	}

	public void setUtilitiesInfos(List<UtilitiesInfo> utilitiesInfos) {
		this.utilitiesInfos = utilitiesInfos;
	}

	public List<Tenant> getBeforeTenant() {
		return beforeTenant;
	}

	public void setBeforeTenant(List<Tenant> beforeTenant) {
		this.beforeTenant = beforeTenant;
	}

	public Building getBuilding() {
		return building;
	}

	public void setBuilding(Building building) {
		this.building = building;
	}

	public BigDecimal getRental() {
		return rental;
	}

	public void setRental(BigDecimal rental) {
		this.rental = rental;
	}

	
	
	
	
	/**
	 * 电表
	 *//*
	@Column(name = "electricity_meter")
	private BigDecimal electricityMeter;
	
	@Column(name = "watermeter")
	private BigDecimal watermeter;*/
}
